
//引入mongoose依赖

const mongoose = require('mongoose');
//连接数据库:h51806
mongoose.connect('mongodb://localhost/h51806');

//Schema 数据结构 :供应商
const providerSchema=new mongoose.Schema({
	provider:String,
	username:String,
	number:Number,
	address:String,
	fax:String,
	time:String	
});

// <<<<<<< HEAD
//修改密码
const pswSchema=new mongoose.Schema({
	username:String,
	newpsw:String
});


//modal集合:供应商
const Provider= mongoose.model('provider', providerSchema);  //对应provider集合

//modal集合：密码
const psw = mongoose.model('psw',pswSchema);

// module.exports={Provider,psw};
// =======
// >>>>>>> 37b78aa1168ab50108ee014713debbe21f346ec2
// 引入“mongoose” 依赖
// const mongoose = require('mongoose');
//连接数据库：h51806
// mongoose.connect('mongodb://localhost/h51806');

//Schema-数据结构：用户
const userSchema = new mongoose.Schema({
  username:String,
  password:String,
  sex:String,
  birthdate:Date,
  phone:Number,
  address:String,
  userType:String,
  regTime:Date
});

//Schema-数据结构：职位
// const positionSchema = new mongoose.Schema({
//   name:String,
//   salary:Number,
//   company:String,
//   logo:String
// });

//Model-集合：用户
const User = mongoose.model('user',userSchema); // 对应"users"集合，mongoDB数据库会默认给上"s"代表复数

//Model-集合：职位
// const Position = mongoose.model('position',positionSchema); // 对应"positions"集合，mongoDB数据库会默认给上"s"代表复数

// <<<<<<< HEAD

// =======
//引入"mongoose"依赖
// const mongoose = require("mongoose");
//连接数据库h51806
// mongoose.connect("mongodb://localhost/h51806");
//Schema-数据结构：账单
const countSchema = new mongoose.Schema({
	name:String,//string数据类型
	unit:String,
	provider:String,
	amount:Number,
	money:Number,
	pay:String,
	time:String
});
//model集合:账单
const Count = mongoose.model("count",countSchema);//对应counts集合（数据库中s是自动生成的）

// module.exports=Count;
// >>>>>>> a0a2f0b29f86a3c12ec7ce539353068cce17158b
// module.exports = {User,Count};
// =======
// module.exports = {User};
// >>>>>>> 602f38b9f7e93fd6e8a53cb2f209dc372086273f
// =======

//mmodal集合:供应商
// const Provider= mongoose.model('provider', providerSchema);  //对应provider集合

module.exports={User,Count,Provider,psw};
// >>>>>>> 79c9b497f3c65895301f80ba782aa12597a0c8a1
// >>>>>>> 37b78aa1168ab50108ee014713debbe21f346ec2
